/*
 * Copyright (c) 2018.
 * http://www.ulabcare.com
 */

package com.mt.roll.upms.params;

import com.mt.roll.core.enums.SexEnum;
import com.mt.roll.core.enums.WhetherEnum;
import com.mt.roll.core.params.BasePageParam;
import com.mt.roll.core.validator.constraints.Enum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Pattern;

/**
 * <p>
 * 系统用户
 * </p>
 *
 * @author jiff
 * @date 2018/11/9
 * @since 1.0
 */
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Data
@Builder
@ApiModel(value = "系统用户查询参数", description = "用于查询用户信息")
public class SysUserQueryParam extends BasePageParam {
    /**
     * 组织ID
     */
    @ApiModelProperty(value = "组织ID，没有指定组织ID时则查询当前用户所能管理的所有组织，包括用户所在组织及所有子组织", required = false, example = "1")
    private Long orgId;
    /**
     * 是否只查询本组织用户
     */
    @ApiModelProperty(value = "是否只查询本组织用户（0、否，查询本组织及子组织用户，1、是，只查询本组织用户）", example = "0")
    @Enum(message = "是否只查询本组织用户只允许0或1", target = {WhetherEnum.class})
    private Integer orgScope;
    /**
     * 系统用户手机号
     */
    @ApiModelProperty(value = "手机号", required = false, example = "13588441519", position = 1)
    @Pattern(regexp = "^1[3456789]\\d{9}$", message = "手机号码格式不正确")
    private String mobile;
    /**
     * 工号
     */
    @ApiModelProperty(value = "工号", example = "10000", position = 3)
    private String code;
    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名", required = false, example = "jiff", position = 3)
    private String name;
    /**
     * 性别（1女，2男）
     */
    @ApiModelProperty(value = "性别（1女，2男）", example = "1", position = 5)
    @Enum(message = "{lis.validator.constraints.SexEnum.message}", target = {SexEnum.class})
    private Integer sex;

    /**
     * 家谱ID，格式：/rootId/.../grandfatherId/parentId/id
     */
    @ApiModelProperty(value = "家谱ID，格式：/rootId/.../grandfatherId/parentId/id", example = "/0/1", hidden = true, notes = "内部使用，不展示给前端")
    private String genealogyId;

}
